Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR対象
カテゴリ
PR の背景
#1988 の第1弾対応です。
以前 #1951 を対応した際、タイプ別設定の折り返し方法に「折り返さない」が選択されている場合において、行ごとのレイアウト幅を求める処理が CLoadAgent::OnLoad と CLoadAgent::OnAfterLoad とで都合2回実行されていることに気づきました。
ファイル読み込み時のフレームグラフ:

2回やる意味はない (と考えている) ので CLoadAgent::OnAfterLoad 側 (↑の右側の赤枠) ではやらないようにします。
仕様・動作説明
対応内容:
CLoadAgent::OnAfterLoad でテキスト最大幅を取得する時、各行のレイアウト幅の再計算をしないようにします。
CLayoutMgr::_MakeOneLine のループ処理においてタブ幅を取得する際、TSV/CSVモードを考慮するよう修正します。(従来「1」で算出していたレイアウト幅と同じになるようにする)
CLayoutMgr::CalculateTextWidth を呼び出しているすべての箇所を確認し、不要なレイアウト幅の再計算をする箇所があれば「1」同様に修正します。
本PRの効果として、
➡ プログレスバーが二度走った後の謎(?)の待ち時間の分がなくなります。
各区間の処理時間 (計測条件などは #1988 を参照):
また、PRの趣旨とは関係のない副産物として、
➡ 「2」の変更により、CLayoutMgr::_MakeOneLine でのレイアウト幅計算でCSV/TSVモードが考慮されるようになったため。
PR の影響範囲
「2」の変更の影響ですが、折り返し方法が「折り返さない」以外の場合は読み込み時間が少しだけ増えてしまいます。
テスト内容
CLayoutMgr::_MakeOneLine の変更によって既存機能に弊害が出ていないことを確認します。
※最も長い行の右端を100%とした位置につまみが表示されることが期待動作
関連 issue, PR
参考資料